from django.urls import path, re_path, include
from catalog import views

urlpatterns = [
    path('', views.index, name='index'),
    path('books', views.BookListView.as_view(), name='books'),
    path('book/<int:pk>', views.BookDetailView.as_view(), name='book-detail'),
    path('authors', views.AuthorListView.as_view(), name='authors'),
    re_path(r'^author/(?P<pk>\d+)$',
            views.AuthorDetailView.as_view(),
            name='author-detail'),
    path('mybooks/',
         views.LoanedBooksByUserListView.as_view(),
         name='my-borrowed'),
]
